const mysql=require('mysql');

const client=mysql.createConnection({
  host: 'localhost',
  user:'root',
  password:'',
  database:'ego'
})

function sqlFn(sql,arr,callback){
  client.query(sql,arr,(err,result)=>{
    if(err){
      console.log(err);
      return
    }
    callback(result);
  })
}
module.exports=sqlFn